package com.simulation.web.service.impl;

import java.util.List;
import com.simulation.common.utils.DateUtils;
import com.simulation.web.domain.TechFile;
import com.simulation.web.mapper.TechFileMapper;
import com.simulation.web.service.ITechFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import static com.simulation.common.utils.SecurityUtils.getUserId;
import static com.simulation.common.utils.SecurityUtils.getUsername;


/**
 * 参数配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-08-31
 */
@Service
public class TechFileServiceImpl implements ITechFileService
{
    @Autowired
    private TechFileMapper techFileMapper;

    /**
     * 查询参数配置
     * 
     * @param id 参数配置主键
     * @return 参数配置
     */
    @Override
    public TechFile selectTechFileById(Long id)
    {
        return techFileMapper.selectTechFileById(id);
    }

    /**
     * 查询参数配置列表
     * 
     * @param techFile 参数配置
     * @return 参数配置
     */
    @Override
    public List<TechFile> selectTechFileList(TechFile techFile) {
        return techFileMapper.selectTechFileList(techFile);
    }

    /**
     * 新增参数配置
     * 
     * @param techFile 参数配置
     * @return 结果
     */
    @Override
    public int insertTechFile(TechFile techFile)
    {
        techFile.setCreateTime(DateUtils.getNowDate());
        techFile.setCreateBy(String.valueOf(getUserId()));
        return techFileMapper.insertTechFile(techFile);
    }

    /**
     * 修改参数配置
     * 
     * @param techFile 参数配置
     * @return 结果
     */
    @Override
    public int updateTechFile(TechFile techFile)
    {
        techFile.setUpdateTime(DateUtils.getNowDate());
        techFile.setUpdateBy(String.valueOf(getUserId()));
        return techFileMapper.updateTechFile(techFile);
    }

    /**
     * 批量删除参数配置
     * 
     * @param ids 需要删除的参数配置主键
     * @return 结果
     */
    @Override
    public int deleteTechFileByIds(Long[] ids)
    {
        return techFileMapper.deleteTechFileByIds(ids);
    }

    /**
     * 删除参数配置信息
     * 
     * @param id 参数配置主键
     * @return 结果
     */
    @Override
    public int deleteTechFileById(Long id)
    {
        return techFileMapper.deleteTechFileById(id);
    }
}
